package com.yc.navy.goods.service.lmpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.navy.goods.bean.AddressInfo;
import com.yc.navy.goods.dto.AddressInfoDTO;
import com.yc.navy.goods.dto.AddressInfoDTODTO;
import com.yc.navy.goods.mapper.IAddressInfoMapper;
import com.yc.navy.goods.service.IAddressInfoService;
import com.yc.navy.goods.util.StringUtil;

@Service
public class AddressInfoServiceImpl implements IAddressInfoService {
	@Autowired
	private IAddressInfoMapper addressInfoMapper;

	@Override
	public int add(AddressInfo addr) {
		if(StringUtil.checkNull(addr.getAname(),addr.getArea(),addr.getCity(),addr.getMid(),addr.getPostal(),addr.getProvince(),addr.getStreet(),addr.getTel())) {
			return -1;
		}
		return addressInfoMapper.add(addr);
	}

	@Override
	public List<AddressInfo> list(int mid) {
		return addressInfoMapper.list(mid);
	}

	@Override
	public int update(long aid) {
		return addressInfoMapper.update(aid);
	}

	@Override
	public int updateAll(Integer mid) {
		return addressInfoMapper.updateAll(mid);
	}

	@Override
	public int deleteone(long aid) {
		return addressInfoMapper.deleteone(aid);
	}

	@Override
	public int updateone(AddressInfo addr) {
		return addressInfoMapper.updateone(addr);
	}

	@Override
	public AddressInfoDTO myaddr(int mid) {
		return addressInfoMapper.myaddr(mid);
	}

}
